"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url,include
from django.contrib import admin

from myhome import cartviews
from . import views

urlpatterns = [
    #首页
    url(r'^$',views.myhomeindex,name = 'myhome_index'),
    url(r'^list/(?P<tid>[0-9]+)/$',views.myhomelist,name = 'myhome_list'),
    url(r'^info/(?P<gid>[0-9]+)/$',views.myhomeinfo,name = 'myhome_info'),


    # 注册  登录  验证码
    url(r'^login/$',views.myhomelogin,name = 'myhome_login'),
    url(r'^logout/$',views.myhomelogout,name = 'myhome_logout'),
    url(r'^register/$',views.myhomeregister,name = 'myhome_register'),
    url(r'^verifycode/$',views.myhomeverifycode,name = 'myhome_verifycode'),


    #购物车
    # 添加
    url(r'^cart/add/$',  cartviews.cartadd,name="myhome_cartadd"),
    # 列表
    url(r'^cart/index/$',  cartviews.cartindex,name="myhome_cartindex"),
    # 清空
    url(r'^cart/clear/$',  cartviews.cartclear,name="myhome_cartclear"),
    # 删除
    url(r'^cart/delete/(?P<gid>[0-9]+)/$',  cartviews.cartdelete,name="myhome_cartdelete"),
    # 编辑
    url(r'^cart/edit/$',  cartviews.cartedit,name="myhome_cartedit"),




    # 确认订单
    url(r'^order/confirm/$',cartviews.orderconfirm,name = "myhome_orderconfirm"),

    # 生成订单(不给用户看过程)
    url(r'^order/create/$',  cartviews.ordercreate,name="myhome_ordercreate"),

    # 添加收货地址
    url(r'^address/insert/$',  cartviews.addressinsert,name="myhome_addressinsert"),


    # 支付页面
    url(r'^order/buy/(?P<oid>[0-9]+)/$',  cartviews.orderbuy,name="myhome_orderbuy"),
    # 支付
    url(r'^order/buy/success/(?P<oid>[0-9]+)/$',  cartviews.orderbuysuccess,name="myhome_orderbuysuccess"),
    # 个人中心,我的订单
    url(r'^myorder/$',  cartviews.myorder,name="myhome_myorder"),


    # 短信验证
    url(r'^sendmsg/$',  views.sendmsg,name="sendmsg"),

    # 地址管理
    url(r'^addrmanage/$',  views.addrmanage,name="myhome_addrmanage"),

    # 地址删除
    url(r'^addrdel/(?P<id>[0-9]+)/$',  views.addrdel,name="myhome_addrdel"),

    # 地址修改
    url(r'^addredit/(?P<id>[0-9]+)/$',  views.addredit,name="myhome_addredit"),

    # 地址修改ajax接收
    url(r'^addreditupdate/$',  views.addreditupdate,name="myhome_addreditupdate"),













]






























































